/* ====================================================== 
   <!-- Navigation -->                                    
/* ====================================================== */
@import '@poemkit/components/_utils/styles/_variable-and-mixin.scss';

/*
 * 1. Primary Menu
 * 2. Sub Menu (Using WordPress default class name )
 * 3. Mega/Dropdown Menu 
 * 4. Dropdown Arrow
 * 5. Right Box
*/



$nav-font-size    : 0.75rem;
$nav-sub-w        : 220px;
$nav-mega-li-w    : 270px;

.poemkit-menu__container:not(.is-mobile) {
	float: right;
	padding-top: 1.25rem;

	/*
	Do not use `position:relative`, it may cause the width calculation script 
	matching problem of the mega menu
	*/

	&.is-fixed {
		padding-bottom: 0;
	}
    

	
	/* 
	 ---------------------------
	 1. Primary Menu
	 ---------------------------
	 */ 
	ul.poemkit-menu {
		font-size: $nav-font-size;
		line-height: 2.34375;
		float: left;
		margin: 0; /* Required*/
		font-size: 0; /*Fighting the Space Between Inline Block Elements*/

		li {
			position: relative;
			margin-bottom: 0;
			padding: 0 1.05rem;

			a {
				display: block;
			}
			

			
		}
		
		

		> li {
			display: inline-block;
			margin-right: 0;
			padding-bottom: 1.421875rem;
			white-space: nowrap; /* Required*/
			font-size: $nav-font-size; /*Fighting the Space Between Inline Block Elements*/

			.poemkit-bubble {
				right: 1rem;
			}

			
			> a {
				text-transform: uppercase;
				font-weight: 500;
				color: #525252;
				
				&:hover {
					color: #000;
				}	
				
			}
			
			
			/* Sync to WordPress activation class name ".current-menu-item" */
			&.is-active, 
			&.current-menu-item {
				> a {
					color: $highlight-color1;
				}
			} 
			
			
			
			ul {
				
				min-width: $nav-sub-w;
				display: none;
				position: absolute;
				padding-bottom: 0.525rem;
				
				li {
					padding-left: 1.25rem;
				}	
			}

			> ul {
				padding-top: 2.625rem;
				opacity: 0;
                
				&::before {
					@include outer-shadow( 'regular' );
					content: '';
					display: block;
					height: 100%;
					width: 100%;
					position: absolute;
					top: 0;
					left: 0;
					margin-top: 0.75rem;
					border: 1.15px solid rgba($primary-text-color, .1);
					background: #fff;
					border-radius: 8px;
				}

			}

		
		}


		/* 
		 ---------------------------
		 2. Sub Menu (Using WordPress default class name )
		 ---------------------------
		 */ 
		ul.sub-menu {
			top: 100%;
			left: 0;
			
				
			a {
				word-wrap: break-word;
				white-space: normal;
				/* Required*/
				line-height: 1.4;
				padding: 0.35rem 0;

				&:hover {
					color: #000;
					background: #F1F1F1;	
				}	
				
			}
			

		}

		> li:not(.multi-column) > ul {
			
			left: 1.784375rem;
			

			/* arrow of sub menu, not mega menu */
			&::after {
				content: "";
				display: block;
				position: absolute;
				top: 5px;
				left: 15px;
				width: 0;
				height: 0;
				border-left: 8px solid transparent;
				border-right: 8px solid transparent;
				border-bottom: 8px solid #ECECE8;	
			}
			
			ul {
				top: 0;
				left: 100%;
				padding: 1.421875rem 0;
				margin-left: -0.071875rem;
				
				@include outer-shadow( 'regular' );
				border: 1.15px solid rgba($primary-text-color, .1);
				background: #fff;
				border-radius: 8px;

				ul {
					margin-left: 0;
				}
				
				
			}	
		}

	}


	/* 
	 ---------------------------
	 3. Mega/Dropdown Menu 
	 ---------------------------
	 */ 
	/* Multi-column */
	li.multi-column {

		span.multi-column-title {
			text-transform: uppercase;
			font-weight: 700;
			color: #B9B9B9;
			display: inline-block;
			cursor: default;
			padding-left: 1.05rem;
		}

		
		> ul {
			width: auto;
			white-space: nowrap;
			display: none;
			padding: 0;

            
            /* add scrollbar to per column */
            max-height: calc(100vh - 50px);
            

			li {
				width: $nav-mega-li-w; /* Required, JS script needs to listen on it for calculation */
				overflow: hidden;
				display: inline-block;
				vertical-align: top;
				padding-left: 0.75rem;
                
                
                
                /* add scrollbar to per column */
                max-height: calc(100vh - 50px - 100px);
                overflow-y: auto;
				&::-webkit-scrollbar-track {
					border-radius: 0px;
					background-color: #fff;
				}

				&::-webkit-scrollbar {
					width: 3px;
					background-color: #FAFAFA;
                    transform: scaleY(0.8);
				}

				&::-webkit-scrollbar-thumb {
					border-radius: 0px;
					background-color:#FAFAFA;
				}

                
	
				.poemkit-bubble {
					right: 1.2rem;
				}
				
				
				a {
					
					&:hover {
						color: #000;
						background: #F1F1F1;	
					}	
				}


				ul {
					position: relative;
					box-shadow: none;
					
					/* Prevent JS script from disturbing */
					margin-top: 0 !important;
				}
			}
	
			
			ul {
				display: block;

				li {
					float: none;
					display: block;
				}

			}

			
		}

		.poemkit-menu__arrow-mega {
			content: '';
			display: none;
			position: absolute;
			top: 56px;
			left: 50%;
			width: 0;
			height: 0;
			border-left: 8px solid transparent;
			border-right: 8px solid transparent;
			border-bottom: 8px solid #ECECE8;
			opacity: 0;
			z-index: 1;
		}
		


	}


	ul.poemkit-menu ul.sub-menu .poemkit-menu__arrow {
		background-color: #000;
		right: 2.159375rem;
		margin-top: 0.3125rem;
	}

	li.multi-column > ul li .poemkit-menu__arrow {
		display: none;
	}

	/* 
	 ---------------------------
	 4. Dropdown Arrow
	 ---------------------------
	 */ 
	.poemkit-menu__arrow {
		display: block;
		position: absolute;
		right: 0.284375rem;
		top: 25%;
		background-color: #000;
		width: 3px;
		height: 3px;
		border-radius: 100%;
	}

	/* 
	 ---------------------------
	 5. Right Box
	 ---------------------------
	 */ 
	.poemkit-menu__right-box {
		float: right;
	}

}



.poemkit-header__container--overlay .poemkit-menu__container:not(.is-mobile) {
	
	/* 
	 ---------------------------
	 1. Primary Menu
	 ---------------------------
	 */ 
	ul.poemkit-menu {
	
		> li {
			
			> a {
				color: #DEDEDD;
				
				&:hover {
					color: #fff;
				}	
				
			}
			&.is-active, 
			&.current-menu-item {
				> a {
					color: #fff;
				}
			} 
		
		}

	}

}



@media all and (max-width: 1250px) {
	.poemkit-menu__container:not(.is-mobile) {
		ul.poemkit-menu {
			> li {
				padding-left: 0.875rem;
				padding-right: 0.875rem;
				margin-right: 0;
			}	
		}	
	}

}


@media all and (max-width: 768px) {
	
    .poemkit-menu__container:not(.is-mobile) {
        display: none;
    }
}

